{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# User's Guide, Chapter 19: Advanced Durations (Complex and Tuplets)\n",
    "\n",
    "When last we encountered the :class:`~music21.duration.Duration` object, it was Chapter 3, and we didn't know about Streams or any of a thousand other cool things that are now under our belts, so it seems a good idea to get back to Duration objects and look in a bit more depth at how they work.\n",
    "\n",
    "We'll recall that one thing that all `Music21Objects` have a `Duration` object stored on their `.duration` attributes:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.duration.Duration 1.0>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n = note.Note('C#4')\n",
    "n.duration"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "...and that durations can be created directly:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.duration.Duration 4.0>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = duration.Duration(4.0)\n",
    "d"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "...and that all durations have `.type`, `.dots`, and `.quarterLength`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('quarter', 1, 1.5)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = duration.Duration(1.5)\n",
    "(d.type, d.dots, d.quarterLength)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The standard `type` values range from tiny 2048th notes up through the immense duplex-maxima:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2048th, 1024th, 512th, 256th, 128th, 64th, 32nd, 16th, eighth, quarter, half, whole, breve, longa, maxima, duplex-maxima, "
     ]
    }
   ],
   "source": [
    "startType = '2048th'\n",
    "try:\n",
    "    while True:\n",
    "        print(startType, end=\", \")\n",
    "        startType = duration.nextLargerType(startType)\n",
    "except duration.DurationException:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The number of dots is limited only by your own imagination (or the limit of expressibility of your computer):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 <music21.duration.Duration 1.0>\n",
      "1 <music21.duration.Duration 1.5>\n",
      "2 <music21.duration.Duration 1.75>\n",
      "3 <music21.duration.Duration 1.875>\n",
      "4 <music21.duration.Duration 1.9375>\n",
      "5 <music21.duration.Duration 1.96875>\n",
      "6 <music21.duration.Duration 1.984375>\n",
      "7 <music21.duration.Duration 1.9921875>\n",
      "8 <music21.duration.Duration 1.99609375>\n",
      "9 <music21.duration.Duration 1.998046875>\n",
      "10 <music21.duration.Duration 1.9990234375>\n",
      "11 <music21.duration.Duration 1.99951171875>\n"
     ]
    }
   ],
   "source": [
    "for dots in range(12):\n",
    "    print(dots, duration.Duration(type='quarter', dots=dots))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For the very curious, try setting the number of dots to `float('inf')` and seeing what happens to `type`, `dots`, and `quarterLength`. (A little Easter egg...)\n",
    "\n",
    "A lot of Duration values can be expressed with all these types and dots, but not all of them.  We can get some more by moving on to Tuplets."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Tuplets\n",
    "\n",
    "Tuplets, such as triplets, can be set by giving a fraction or close approximation to a fraction as a quarter length:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.duration.Duration 1/3>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = duration.Duration(0.3333333333333)\n",
    "d"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The quarterLength of a duration such as this will be expresssed as a `fractions.Fraction` class:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Fraction(1, 3)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.quarterLength"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This can be converted to a floating point approximate representation by wrapping it in the `float()` function:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.3333333333333333"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "float(d.quarterLength)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can check that this duration represents a triplet by looking at the `.fullName` property of the duration:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Eighth Triplet (1/3 QL)'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.fullName"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "But where is the information about the triplet stored?  It's not in the type or dots:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('eighth', 0)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(d.type, d.dots)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Instead it's to be found in the `.tuplets` property:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<music21.duration.Tuplet 3/2/eighth>,)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.tuplets"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "One thing that we learn from the property is that there's a separate class that defines tuplets, the `duration.Tuplet` class.  Let's look at what it can do.  We can create a simple Tuplet by passing in the number of notes to be played in the place of another note.  For instance, a 5-in-the-place-of-4 Tuplet is created like this:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.duration.Tuplet 5/4>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fiveInFour = duration.Tuplet(5, 4)\n",
    "fiveInFour"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Each Duration that has a 5:4 tuplet applied to it will be 4/5ths as long as it would be without it.  I know this by querying the `.tupletMultiplier()` method"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Fraction(4, 5)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fiveInFour.tupletMultiplier()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "At this point, the tuplet represents any 5:4 tuplet -- whether 5 quarters in the place of 4 quarters, or 5 16ths in the place of 4 16ths.  If it's important to know that this represents 5 eighths in the place of 4 eighths, we can call `setDurationType()`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "fiveInFour.setDurationType('eighth')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can ask how many quarter notes (i.e., what quarterLength) will be necessary to fulfill the promise of the tuplet:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.0"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fiveInFour.totalTupletLength()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This changes if we change the durationType.  Let's say that it's five dotted quarters in the place of four dotted quarters:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "6.0"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fiveInFour.setDurationType('quarter', dots=1)\n",
    "fiveInFour.totalTupletLength()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also create tuplets that represent unusual cases, such as 11 sixteenth-notes in the place of one doubly-dotted quarter note:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.75"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "oddTuplet = duration.Tuplet(11, 1)\n",
    "oddTuplet.durationActual = '16th'\n",
    "oddTuplet.durationNormal = duration.Duration('quarter', dots=2)\n",
    "oddTuplet.totalTupletLength()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Fraction(7, 11)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "oddTuplet.tupletMultiplier()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Okay, let's get back to simpler tuplets.  Like our 3:2 triplet.\n",
    "\n",
    "Tuplets have a `.type` which is usually None:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trip = duration.Tuplet(3, 2)\n",
    "trip.type is None"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "the `.type` will be \"start\" if `music21` or a user of it has determined that this tuplet begins a tuplet bracket or grouping.  It will be \"stop\" if it ends a grouping, and it'll be startStop if it's an isolated tuplet that both begins and ends a grouping.  None means that no determination has been made about whether this is the beginning, middle, or end of a bracket.  (Eventually we will support `False` to mean do not end a bracket here in any case).\n",
    "\n",
    "Of course a bracket will only be drawn if you want one, which means that `.bracket` needs to be True."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trip.bracket"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And we'll need to know what should go in the bracket.  Usually, we just want the number \"3\" to go in the bracket:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('number', None)"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(trip.tupletActualShow, trip.tupletNormalShow)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If we wanted \"3:2\" then we'd set \"trip.tupletNormalShow\" to \"number\". "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAboAAABsCAYAAAAc53cDAAAACXBIWXMAAB7CAAAewgFu0HU+AAAUv0lEQVR4nO3deZgcdZ3H8fdkJpPDhIQcRCBAkJtAOOQI9xjlxiiCLuuiXEZ5UHaDu4qwsIgi4HLLJUgWHlQURURw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/23nauKrR4f59tFuSQ7sRnYz3ygbeYzM5SfrvxpttNDoY2E+P1a/9jz5nrNZ+fxYUq9mb6ReDNzsvF6NfXN6Hza45l3AMzW2vwL7prUB67vSbu4jvKXd2dRuwBNnMZZE14SsW9XEfsUmFg6rzcjqnOl8Ne8yrNGJ3+HYiE6NivuMvdXEfqWEOqmeYPUe6m/gcrZvu3Myia51raTxb5PrgAPzD7nt6Zy1lmvR+ZIEtsRaVbp/BL8jvuvBMOB6X/lfED0pa7taSOMfwOMLiFd0zlpNo7cNdL7a2CSswYn7x7ACq8Y8DtgL2A04GrgKeNtX7meoeW6YO0j+AXwXmFpEsALonLWa09D5kgaMA+6mvj+YFVh1pZpSh9sOm9Cx3g/g4/RtVSb50jlrLZug8yVNmIzNaPAmff9YZmOzGmxZWHStYz/gFeI/fE8Cx6Kq37LQOWstOl9tIuuTNwwYhQ1ptBANR5VUF9bvbQqwBdZlYz72heF+7EMq5aJz1lp0vtrA/wOmNCgUsSEfoQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 54,
       "width": 221
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "n = note.Note()\n",
    "n.duration = duration.Duration(2.0/3.0)\n",
    "n.duration.tuplets[0].tupletNormalShow = 'number'\n",
    "s = stream.Stream()\n",
    "s.repeatAppend(n, 3)\n",
    "s.insert(0, meter.TimeSignature('2/4'))\n",
    "s.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also set it to \"type\" or \"both\" to add the note shape to the bracket, but unfortunately, no MusicXML client yet supports this display on input or output."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we're ready to return to the `Duration` class.  Since the `.tuplets` property returns a tuple (appropriately enough), it's not something that can be manipulated directly.  To add a tuplet to an existing duration, use the `.appendTuplet(t)` method:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABdgAAABrCAYAAABkKeB0AAAACXBIWXMAAB7CAAAewgFu0HU+AAAgAElEQVR4nO3deZgkVZmo8be7qze6m24QaGhWRVYRFNlcYBAcBVFUxIs6KOh1wQWVO6LolVEBFRHGDRcUFIVRfEYQUJRxAR1AwBFRRGiRTYUWaHa66Q267h8n8lZGVGZWLhFxIqPe3/PEE5EZS3751amoqBMnzgFJGu/TwGiH6ax4oUnS0PLcKkn52gBYRudz6xbRopOk4eQ1q9SjkdgBSKqcBcA7gLuB09tsc0l54UhSLXhulaT8vReYA3wLWNxi/aPA30qNSJKGm9eskiTl4HjCXen3xw5EkmrEc6sk5Wtd4CFgKTA7ciySVBdes0p9mBo7AEmVMofQEghgU+DZEWORpLrw3CpJ+XsHoaXlWuAQYF7ccCRp6HnNKklSDo5hfP9qVwHbxwxKkoac51ZJytcs4B7S59XlwLHYiEyS+uU1qyRJOTiP1oOYrABeGDEuSRpmnlslKV/b037wvR8DU+KFJklDy2tWSZJyMAvYG/gocCvpP6p/B9aLF5okDS3PrZKUvy2Aw4ELgdWkz632HSxJvfOaVZKknE0D/pVwt7rxR/XEqBFJ0vDz3CpJ+due0I1B47y6ClgnakSSNNy8ZpV6MBLpczcA5gO3Rfr8OpgHHBQ7CA2V24Hf9LD9k8BphD+kpyXv7d7Ffi8i/I5LDVcCd8UOokvPBraLHYSGys+B+3vYvp9z67rAS3sPTTW2EriYMLhj1U0FXgHMjB2IhsYjwE963GcxcCBwE2FgvhnAzsA1HfbZFdi2nwBVWzcDf4gdRJc2B54fOwgNleuBP/ewfb/1AYcSr65R1XQJ8FjsIOpoP2ApYRCaHSPHMszOon2/g05OraYz6c80wu/sKLCki+2vrMB3darWNCw3U+cQP1dOwzftRX96Obd26mvYafJOb2I4vJX4uXIarulG+veepuO8bYJtP1eB7+pUvWk2w+Eu4ufKabim99GfXusDllXguzpVazqDSaDsu0pHECr5Gp/7n8Buh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CYII=\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 53,
       "width": 748
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "t = duration.Tuplet(5, 4)\n",
    "t.setDurationType('16th')\n",
    "d = duration.Duration('16th')\n",
    "d.appendTuplet(t)\n",
    "n = note.Note('E-4')\n",
    "n.duration = d\n",
    "s = stream.Stream()\n",
    "s.repeatAppend(n, 20)\n",
    "s.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Once a `Tuplet` is appended to a `Duration`, it becomes \"frozen\" and no further changes to its duration can be set (though its `.type` and display styles can still be changed).  This is to prevent changes to the duration that won't be reflected in the `Duration` object: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t.frozen"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Nested tuplets can be created by adding more than one tuplet to the duration:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABdgAAAB5CAYAAAAqN0PkAAAACXBIWXMAAB7CAAAewgFu0HU+AAAgAElEQVR4nO3dedgjZZWw8btXupuG7mZtQPZ9EZBNYBQRVBQRBeZjUVFEVBxRGRQFnREGURwVUVFAhQEXFEZFVFQUVFQUXFBAZJFFdtmhaRp67++PU5mk81Zlr1QluX/XlasqlUpy3if1VqpOnjoPSJIk5W8d4MfAc8Cymtuvksckqd/eCnwZ+BOwgOp+aYMmzzuD5fdj9beD8wlXkiRJkiRJo2gm8FfgKeBC4AfAQqrJqN8UF5qkEXYCcAnwCNX90cNNnrMa8AyNE+zr5RSvJEmSSmhi0QFIkqSh9z9Ekv2FwG3Jsv2B7yfzLwLWB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th9JS7Cvwujui1an+ne9t+BYVF7bUd1OTis4FkmSJJXYrsRlsmm9nm4hev2sV1h0g2M34A4an5heBxyAJXY6ZRv3h+3cH7bz4JlKlFVr9Jk9B1xF9Jo1sa5eWxk4ghg8eRGtJ8aXkb09juq+aC2qf9+/FxyLymsnqtvJJwuORZIkST2S94nNisQls4uBx4mTN7VuIrAfsBewLlH382Hih4qfECew6o5t3B+2c3/YzoPphcSP07OIhPocogzM34jPbklxoWnI3Ub7A+XeA3yBKGOUZRT3ResRbQPwAaIElFRvFnAYMA34OfCXYsORJEmSJEmS1Kl2eqzPAV7OcPU676WNqLbVCQXHIkmSJKmPxhcdgCRJkkpnCXA5cHxyfy5wBZFA1liTauY9vpYkSZJGiCcAkiRJqriN6IG9HvAq4NJiwxkYE2vmJxQWhSRJkqS+m9h8FUmSJA2hR4HVgfuJQXdXBY4leq6rPSbYJUmSpBFlD3ZJkqTRtCvwEmB94NaCYxl0loiRJEmSRpQ92CVJkkbTXclN3XscuIG4CuC2gmORJEmS1Ecm2CVJkqTu/APYvuggJEmSJPWfl7BKkiRJkiRJktQBE+ySJEmSJEmSJHXABLskSZKyPAksAh4uOhBJkiRJKiNrsEuSJCnL48AGwLyC45AkSZKkUjLBLkmSpCV101oP9jMQSZIkSRokE4oOQJIkSYWbB8wBzgcWFByLJEmSJA2M/w8PVLW46Se+AgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 60,
       "width": 748
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import copy\n",
    "s = stream.Stream()\n",
    "s.repeatAppend(note.Note(), 4)\n",
    "\n",
    "t32h = duration.Tuplet(3, 2, 'half')\n",
    "t54q = duration.Tuplet(5, 4, 'quarter')\n",
    "n1 = note.Note()\n",
    "n1.duration.type = 'half'\n",
    "n1.duration.appendTuplet(copy.deepcopy(t32h))\n",
    "s.append(n1)\n",
    "for i in range(5):\n",
    "    n = note.Note(61 + i)\n",
    "    n.duration.type = 'quarter'\n",
    "    n.duration.appendTuplet(copy.deepcopy(t32h))\n",
    "    n.duration.appendTuplet(copy.deepcopy(t54q))\n",
    "    s.append(n)\n",
    "s.notes[4].duration.tuplets[0].type = 'start'\n",
    "s.notes[5].duration.tuplets[1].type = 'start'\n",
    "s.notes[-1].duration.tuplets[0].type = 'stop'\n",
    "s.notes[-1].duration.tuplets[1].type = 'stop'\n",
    "s.repeatAppend(note.Note('G4'), 4)\n",
    "s.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For nested tuplets, it's important to explicitly state where tuplet brackets start and stop. As you can see from the output, MusicXML rendering of Nested tuplets is still hard for our partners at MuseScore which generated the image above (Finale renders a --5-- bracket around the five quarter notes.  However, MIDI rendering is correct:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "tags": [
     "nbval-ignore-output"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "                <div id='midiPlayerDiv1743'></div>\n",
       "                <link rel=\"stylesheet\" href=\"//cuthbertLab.github.io/music21j/css/m21.css\"\n",
       "                    type=\"text/css\" />\n",
       "                <script>\n",
       "                require.config({\n",
       "                    paths: {'music21': '//cuthbertLab.github.io/music21j/src/music21'}\n",
       "                });\n",
       "                require(['music21'], function() {\n",
       "                               mp = new music21.miditools.MidiPlayer();\n",
       "                               mp.addPlayer('#midiPlayerDiv1743');\n",
       "                               mp.base64Load('data:audio/midi;base64,TVRoZAAAAAYAAQABBABNVHJrAAAAjAD/AwAA4ABAiACQPFqIAIA8AACQPFqIAIA8AACQPFqIAIA8AACQPFqIAIA8AACQPFqKVYA8AACQPVqEIoA9AACQPlqEIoA+AAGQP1qEIoA/AACQQFqEIoBAAACQQVqEIoBBAACQQ1qIAIBDAACQQ1qIAIBDAACQQ1qIAIBDAACQQ1qIAIBDAIgA/y8A');\n",
       "                        });\n",
       "                </script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "s.show('midi')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The effect of any set of tuplets on the overall duration of a note can be found through the `.aggregateTupletMultiplier()` method:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Fraction(10, 21)"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = duration.Duration('half')\n",
    "d.appendTuplet(duration.Tuplet(3, 2))\n",
    "d.appendTuplet(duration.Tuplet(7, 5))\n",
    "d.aggregateTupletMultiplier()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Unlinking Durations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Each `Duration` object has four essential pieces of information, the `type` (whole, 16th, breve, etc.), the number of dots (or `dotGroups`, discussed below), a list of zero or more tuplets, and the overall length of the duration (`.quarterLength`).  Generally speaking, changing one of these pieces of information changes the one or more of the others:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('half', 1, (), 3.0)"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = duration.Duration(3.0)\n",
    "(d.type, d.dots, d.tuplets, d.quarterLength)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('half', 1, (<music21.duration.Tuplet 5/4/half>,), Fraction(12, 5))"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.quarterLength *= 4/5\n",
    "(d.type, d.dots, d.tuplets, d.quarterLength)"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    ".. note::\n",
    "\n",
    "    Versions of music21 prior to v.6 would half called this a \n",
    "    5-in-the-place-of-3 whole note without a dot, which\n",
    "    a bit of scratching the head math will confirm is also valid."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('16th', 2, (<music21.duration.Tuplet 5/4/half>,), Fraction(7, 20))"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.type = '16th'\n",
    "d.dots = 2\n",
    "(d.type, d.dots, d.tuplets, d.quarterLength)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "However, there are times when we might want to separate one piece of information separate from another.  For instance, [in some pieces](http://homes.soic.indiana.edu/donbyrd/InterestingMusicNotation.html), Brahms uses a dotted half note to mean a note that is eleven sixteenth-notes long, rather than twelve.  We can represent this in `music21` by setting up the type and dots and then setting `Duration.linked` to False."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('half', 1, 3.0)"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = duration.Duration()\n",
    "d.type = 'half'\n",
    "d.dots = 1\n",
    "(d.type, d.dots, d.quarterLength)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.linked"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('half', 1, 2.75)"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.linked = False\n",
    "d.quarterLength = 11/4\n",
    "(d.type, d.dots, d.quarterLength)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In theory, the musicXML spec allows us to preserve such note lengths in notation, but in practice no notation software will support this, correcting the error in the difference between .quarterLength (in MusicXML divisions) and type:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAABjCAYAAACPMiv5AAAACXBIWXMAAB7CAAAewgFu0HU+AAASJUlEQVR4nO2de5QcdZXHP5OZECavSUJ4Q0gEAkFIVJ4SJBowPlBAdF0QRXE5R/TIAuLC6gq+syAouAdQQQ4o+NrdbHi5K4tZBALEsErUzcOAJGFJAgskJCGEyZD0/nGrT9VU/X5V/ajq7un+fs6pU69b9bvd03PrV/d3f/dC45kNvABsBQ5rQvtCCCFy5OPAAFAKlqVAb1M1EkIIUTNnAjsIjXp5mdtMpYQQQtTG0UA/SaNeCo4f2jzVhBBCVEsf8DRuo15e5jdNOyGEEFVzLelGvQTsBN7ULAWFEEJUzsHAdrINewn45ybpKIQQogpuJdugbwzWA8A+zVFTCCFEJeyDf8C0hPXkrwHGAeuDY19phqJCCCEq4xL8Rn0tcHxE9o7g+KoG6yiEEKIKFuI26iuAvWKyF0bOv7WBOgohhKiQXYHXSRr1Vbj96LMjMtc1SEchhBBVcBRun/rRHvkDGdyjF0II0WKcTdKwX5EiPz4mu2/RCgohRLsyrKD7jo/trwOuTpF/NbZ/Qr7qCCFE51CUYR8T278K2JYiH8/w+MZ81RFCiM6hKMPeFdnejoUzpjE2tj8tX3WEEKJzKMqw74xs3w9syJCfHNvfM1dthBCigyjKsA9Eth+pQP7w2H5fjroIIURHUZRhfy2y/fsK5I+N7ffkqIsQQnQURRn2rZHt5yvQ4T2xY5vyVUcIITqHogz75sj2yxmyJwK7x45tzFcdIYToHHqAWwq4bzQXzDWk98BnO45Nohi9hBBiqHAcZqOXkuzsjgFmeK57ogcrW5c3m4D3BtsvAM965MZjRjzOioL0SmMkcBiwPzZ4Ox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88GAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 49,
       "width": 187
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "r = note.Rest(type='16th')\n",
    "n = note.Note()\n",
    "n.duration = d\n",
    "s = stream.Stream([meter.TimeSignature('3/4'), r, n])\n",
    "s.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "(but the output looks good for a single note.)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Unlinked durations come in handy if, for instance, we're parsing in notes from MIDI or an audio file and we want to retain the exact quarterLength duration (or set qtr=60 and just store the number of seconds) but have type that represents the closest notateable type."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## DotGroups -- a small digression from the Middle Ages..."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There's actually one more thing that durations store, and it's a little bit silly for most uses, but reflects `music21`'s commitment to being able to represent all the music that's been notated over time.  In the Middle Ages, it was common to have notes that were worth 9 or 27 times smaller note values.  In modern transcriptions, a note worth 9 eighth notes is often notated as a dotted-dotted half note, that is to say, a dotted half note which is itself dotted (or 1.5x the length of a dotted half note).  See the [second example from my blog post about dots](http://prolatio.blogspot.com/2013/10/advanced-dotting.html). These dotted-dotted notes are represented by \"dotGroups\" in music21, which is a list of the number of dots at each level of dotting.  For instance:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAABiCAYAAABTTGiVAAAACXBIWXMAAB7CAAAewgFu0HU+AAAUOUlEQVR4nO2de7wdVXXHvzf3Bm6SGxIIjwCGIA/DMyCCgrw0KK1QH4UW0ELx02JrWxBELEUNoB8KpFKwFlQKNChqKRWM1dYHWEBBAQGp5RECCMgrkEhCwr153CSnf6wZZ585e895zMw5d5Lf9/OZz5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V49uxnmxqkBnypR37HGLIrJ8S9Et9kNLZDc5PBVgfJtoXqwMac5snuVpawQQoh8PE3Y0G/ACo5nuY2GnGssKFVTIYQQufgI9aUNvwx8DUtxvH8L518dnbsO2K8kHYUQQhRAP/WFThbQ+kTwuc5555WinRBCiELZiaQweA24neyQzSHgKkf+O5RTxlAIIUQJzAaeJTHiw1iOneOBAzF3zbFY+cDFjtzN5CsGLoQQogdsB9xCa5E7w5gbp78nmgohhCiEg4FrsVqwaUP/GPA5zA0khBCii/w/AKPbilGOKb8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 49,
       "width": 190
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "n = note.Note('C5', type='half')\n",
    "n.duration.dotGroups = (1, 1)\n",
    "n.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Since no current MusicXML readers support dot groups, they are represented by the closest acceptable notation unit, respecting the fact that they are essentially dotted-dotted notes."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Durations that take no time at all.\n",
    "\n",
    "Among the duration types, such as 'half', 'whole', etc. there's one strange `type` called \"zero\". \n",
    "Durations with type \"zero\" measure objects that don't have any length at all.  It's\n",
    "used for measuring the conceptual length of grace notes,\n",
    "spaceless objects like `Clefs`, Liz Taylor's marriages,\n",
    "etc.:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.duration.Duration 0.0>"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "k = key.KeySignature(3)\n",
    "k.duration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'zero'"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "k.duration.type"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "sphinx_links": {
     "any": true
    }
   },
   "source": [
    "We will talk more about zero-duration objects when we get to Grace Notes in :ref:`Chapter 27<usersGuide_27_graceNotes>`."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Complex Durations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Counting notes isn't as easy as we might think. For instance, listen to this little \"piece\":"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "tags": [
     "nbval-ignore-output"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "                <div id='midiPlayerDiv1972'></div>\n",
       "                <link rel=\"stylesheet\" href=\"//cuthbertLab.github.io/music21j/css/m21.css\"\n",
       "                    type=\"text/css\" />\n",
       "                <script>\n",
       "                require.config({\n",
       "                    paths: {'music21': '//cuthbertLab.github.io/music21j/src/music21'}\n",
       "                });\n",
       "                require(['music21'], function() {\n",
       "                               mp = new music21.miditools.MidiPlayer();\n",
       "                               mp.addPlayer('#midiPlayerDiv1972');\n",
       "                               mp.base64Load('data:audio/midi;base64,TVRoZAAAAAYAAQABBABNVHJrAAAAKAD/AwAA4ABAAP9YBAUCGAiIAJA8WpIAgDwAAJA9WpYAgD0AiAD/LwA=');\n",
       "                        });\n",
       "                </script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "s = stream.Stream()\n",
    "s.append(meter.TimeSignature('5/4'))\n",
    "s.append(note.Note('C4', quarterLength=2.25))\n",
    "s.append(note.Note('C#4', quarterLength=2.75))\n",
    "s.show('midi')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That sounds like it has two notes in it to me! But look at the best representation of it on a page:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "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tlNXYWvRBbOWORc38+doBaml74TW8UdiDZ3rmMdbZtg+UfHIx93u7nCfGfeTuWyPdJ4GFsMtSbaQVfQEdj43mvwlriurqTgKOwv3k8pbleo75H7mObsJPDd7E0QRuwlq63sIrMG1hls7vqj32m47GyOhZrte6HVRSHYUNFelH+2fr5T/BWYV3SM4G/OdciuVDFUZL2CawFbH+s4jMc+5GMq+C4wn5EO7AD1QbsgL4Mq1huxiqeq7GxXauxFs7l2Czx5diBbXkCf1OthmGpUkYAI537rc5lKFbpG4StxrAD9hkNxD6nFiwhNcQfVAjs436+bVh39GtYAt+ngN8n8DdJ1zcJ6+I8EJspPxprsfZXcKopu+5+btaGjVhFcyXWctkLK69rsArRKryy65bf97ATx47G/6ya9MVO0NyyOxQrv8Ow4QpDsLI7GOiNtfC3YpXC3ljZ9f/WucI+t2D5bsc+l7ewXoCnsZbE+Y3/WSLJUcVRsjICOAQ7494d61Z1D0zuclbVVJSCgj/Qfu5rtDvv4T+Dd6/DxoC5Xbhul7x7MAheCFy3Y62A1cZVSdjnsQmb7LAY6/5/EZvUNBOrKIuk4RDgAGBPYDfshKcV+45uQX1lF6LLif81NmNlMK7c+stvG15rfFjZdU/M/GV3o/N3xMUUjCtOWMVxvXN7GdajMgcbvvM4Vo5FCkEVR2kWY7FWDrd7dmusW3YMdrY/AO+MvoPo724zfqejDkSdeH9PO1YhXIZVChfhdf29jh1kuuv4Q2lu/fHG6I3DumfHYOV3JNaavgXW0riJ6HWPm7HsQnz5dbvuN2Atp+6Qm4WUdturYihdxv8DwiolX7vQBMAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 58,
       "width": 327
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now it looks like it has four notes in it!  Which number is right?  It depends on what is most important to you.  Sometimes you will want to work with the specific graphical symbols on the page.  Sometimes you only care about the number of distinct sounds.  And quite often you'll want to change from one representation to another within the same analysis task.  `Music21` makes moving between these two representations possible and after a while quite simple using the concepts of ties and complex durations."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Complex `Durations` are those that can't be expressed easily\n",
    "as a single written `Note` on a page.  For instance, a `Note`\n",
    "lasting a half-note plus a sixteenth-note can't be written as\n",
    "a single `Note` graphic, but it's perfectly fine to use as a\n",
    "quarterLength."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "oddDuration = duration.Duration()\n",
    "oddDuration.quarterLength = 2.25"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `type` for these odd values is called \"complex\":"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'complex'"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "oddDuration.type"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Complex types have multiple \"DurationTuple\" objects in `.components` that represent the smaller, simple durations that make up the entire Duration:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(DurationTuple(type='half', dots=0, quarterLength=2.0),\n",
       " DurationTuple(type='16th', dots=0, quarterLength=0.25))"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "oddDuration.components"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Some durations have multiple components even though they might not need them:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(DurationTuple(type='quarter', dots=0, quarterLength=1.0),\n",
       " DurationTuple(type='eighth', dots=0, quarterLength=0.5))"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = duration.Duration(1.0)\n",
    "d.addDurationTuple(duration.DurationTuple('eighth', 0, 0.5))\n",
    "d.components"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'complex'"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.type"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For these durations, there's a method called `.consolidate()` that will put both of these components together into one component.  In this case, it's a nice dotted quarter note:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('quarter', 1, 1.5)"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.consolidate()\n",
    "(d.type, d.dots, d.quarterLength)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(DurationTuple(type='quarter', dots=1, quarterLength=1.5),)"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.components"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "However, forcing something that really should have multiple components into one creates an \"inexpressible\" type that can't be outputted to most formats:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'inexpressible'"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = duration.Duration(5.0)\n",
    "d.consolidate()\n",
    "d.type"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(DurationTuple(type='inexpressible', dots=0, quarterLength=5.0),)"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.components"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To fix this situation, the easiest thing to do is just to assign the duration its own quarterLength."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(DurationTuple(type='whole', dots=0, quarterLength=4.0),\n",
       " DurationTuple(type='quarter', dots=0, quarterLength=1.0))"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.quarterLength = d.quarterLength\n",
    "d.components"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Splitting and Tied objects:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In the last section we ended up with a Duration object with two components, a whole-note's duration and a quarter-note's duration.  We can conceive of either one note having this duration, or two notes with this duration that are tied together.  Let's look at how to move from one view to another, first by attaching the duration to a note."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAABiCAYAAABH9TQxAAAACXBIWXMAAB7CAAAewgFu0HU+AAAVL0lEQVR4nO2debQcVZ3HPy/vJSELWUhISCALhoRFEpBFwiJLBEZk9KBnFAY8M4I4w4woMKAGDyIKggjn4HgUjQwyA4rAOGyugAhoICyyCSEQ9iUESMhC8pK8vOT1/PGrsqqr61ZXdVf18t73c06dqrp9+9avu6vvr+79LRcazzxgBdAN7NGE6wshhGgj/hnoBUrethgY1lSJhBBCtCwnAFsJlIa/XdxMoYQQQrQm+wM9VCqNkle+W/NEE0II0WqMBl4iXmn42y1Nk04IIUTLcQXJSqME9AF7N0tAIYQQrcNMYDPVFUcJuKlJMgohhGghrqG6wljt7XuByc0RUwghRCswGbdBvISNRC4HxgDLvbILmiGoEEKI1uBs3EpjGX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8gjRfdUbAg6wTu/FzgJC8iJYyRwKbZkLFhQ2XHE/3GFqIUZwAewRWemYk/WO2JP36Owp+surKON3neNTFvvd8yNulYYf1ThK7FubJS1HPvvLsOm/BZjiiHNw6AYIOR1084BfoX9ScGMY//rlb2K3Zg7AUdihk0/OOxm73ygLNwkWo8pmAfP+zDlMgnzYBvjbaOx6dfh2NO9PzLoJHga30K5TSYtWRWH39mHp9/8zn8L5urcQ7CK5Vps0aK1mEJ4F5uOW+ptmzLKKwSQ79PORMyz4hMp6m7Aloj9Ls1ZJlaIPBmOjaSHYqOZoZiCGRqzDcYUkO9F5NtderFOfzOBAuiJlG0iUApC9CvmYimM36TSNXcJ8C2CkYkQQog24/8B4GJCiJQ2O4IAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 49,
       "width": 199
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "n = note.Note('F#4')\n",
    "n.duration = d\n",
    "n.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now let's split this Note according to its component durations using the :meth:`~music21.base.Music21Object.splitAtDurations` method found on every `Music21Object`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<music21.note.Note F#>, <music21.note.Note F#>)"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "split = n.splitAtDurations()\n",
    "split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[4.0, 1.0]"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[subNote.quarterLength for subNote in split]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "So now instead of one note with the duration of 5.0 quarter notes, we have two notes, one which is a whole note and the other which is a quarter note.  If we put both of them into a stream, we can see how they look:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAABiCAYAAACI2wDyAAAACXBIWXMAAB7CAAAewgFu0HU+AAAXJklEQVR4nO2deZQdVZ3HP93ppLPvG8gShIQ9QAAJqBhRUEE5yAwKbuM6MioDjvuMMg6iowMO6hEdt4MDgytHRGdxRBAERFAQHCFhB4WELSQh6YRe0j1/fKvOq65XVe/Ve6/e1t/POXXqVtWtW7/u99791b33t0DzOQ54ChgADmjB840xxpgJx18Bw8BYsN0FTGupRMYYY0yXczqwk5LyDbfPtFIoY4wxpps5EhikXPmOBef3a51oxhhjTHcyB3iQZOUbble2TDpjjDGmS7mIbOU7BowCh7ZKQGOMMabbWA4MUVkBjwE/aJGMxhhjTNdxCZUV76ZgPwzs2hoxjTHGmO5hV9INr8bQyPhCYC6wITj3yVYIaowxxnQTHyBd+T4GHBOp+x/B+YeaLKMxxhjTddxIsvJdByyN1T07cv3oJspojDHGdBVTgRHKle9DJK/zHhep84UmyWiMMcZ0HUeQvOZ7ZEr9vRk/QjbGGGNMDbyRcgV8bkb9ebG6zytaQGOMMaaV9BbU7rzY8Xrggoz622PHL2qsOMYYY0x7UZQCnhU7/hywI6N+PCPSgY0VxxhjjGkvilLAPZHyEHIzymJ27Hj/xopjjDHGtBdFKeDRSPlq4JkK9ZfFjpc0VBpjjDGmzShKAQ9HyjdVUf+g2PGcBspijDHGtB1FKeDnIuXbq6h/VOy4r4GyGGOMMW1HUQp4IFJ+ogoZXhU7t6Wx4hhjjDHtRVEK+NlIeXOFuscCi2LnNjVWHGOMMaa96AO+VUC70VjPF5I9oj0u4dweFCOXMcZ0CvOBA1CchGqW8orgeGAr8JsWPb8TmA6sCsq/ZrwRMiiw1F5JN/YBDxYg0BbgxKD8FPBoSr15SNnGWVeQXJXYC3gpkvcRNJIfAvrRS8XzkYX294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vkICuAA8PfAP9cpizHVMB+NnpejHMy7B9vzUGc/A3XqocINXanCUVLe30y0c48q8qS24u5bY8E9I8E2jEbq2xn/AjAS7KN1w+PRyHFYHo1c34KUXi9SZNH9pMjxpGBLK09CLxZL0cvOlITr4QtQklIci5Wj12rpp5IUcPj3h6k3NyC/2sfQskRoS3BfDc8zJjeNSG23B3ojDF2NrkMuKGnrljOBz6EoLqA1kVNwlh/TfixBynqPYFtMae15IRqJzUIjtn7GKxlI/k63WzrJuLJrF9L+d6FiDWceBtE08Ba0TLCR0ozDY6gfWgfcXbzIxuSjUT+8lcBPUScFekP/YXDuEfRD2Q14OXAG6thAfm1nYKME030sRqPqcO1xKZoyXYLWsqejl9Fwm4aUeD9alwxHj72MHznGXVigvpfXRijg8P5hJHvYbjiSj464w1H8IBqJDgTb1mC/HU3Lb0PJXZ6gZMj0CF5/N11EI998lwBfBV5bRd3twPnAv5Bs9WuMSacXTRtPQQovuu8LypNj16LbJEpKPmxvONii091J2xD6zQ5FjsPydqRUjTEtYjXKorOe8hBqa4HzKI2UjTHGmAnJ/wPNQWcTFXaGkwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 49,
       "width": 240
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s = stream.Stream()\n",
    "s.append(split)\n",
    "s.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice the one subtle difference between the two representations.  In the second case, since there were two notes (and not explicit time signatures), the Stream was allowed to split the notes into two measures in order to use the more common time signature of 4/4.\n",
    "\n",
    "But how does the Stream know that the two notes should have a tie connecting them?  The answer is that `splitAtDurations` sets the `.tie` attribute on each of the notes:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.tie.Tie start>"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "split[0].tie"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<music21.tie.Tie stop>"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "split[1].tie"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We will learn more about Ties in :ref:`Chapter 31, Clefs, Ties, and Beams <usersGuide_31_clefs>`."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When splitting an object such as a :class:`~music21.note.Rest` that doesn't use ties, music21 is smart enough not to add ties:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAVwAAABiCAYAAAAcEWtFAAAACXBIWXMAAB7CAAAewgFu0HU+AAAP3ElEQVR4nO3deZAcZRnH8e9uFpJgEgIEwiEQwQRFiAengJyKShDRlEd5gmKpWDEgikoVqBQiCApeCCKFHCIeyFF4GxVEQCgRxJCImAUVYhJiEtYQdjfJ+MfTXf1OT7/dc3X3HL9P1dQc/U73s5B5puft931eKN7RwCpgPbB3CccXEekL7wXGgUpwWwxMLjUiEZEe9HZgE1GyDW/nlxmUiEivOQAYpTbZVoLXX1ReaCIivWNrYBnJyTa83VxadCIiPeQS0pNtBdgMvKysAEVEesFsYIzshFsBflBSjCIiPeFqshPtmuB+HNi5nDBFRLrbzvgvlFWwM9+LgenA8uC1z5YRqIhItzsDf7J9EjjEaXt98PpwwTGKiPSEu0hOtkuBHWNtFzrbX1lgjCIiXW8SsJHaZDtMcj/t0U6bSwuKUUSkJ+xPcp/tAZ72e1J9BiwiInV6J7UJ95yU9tvE2u6Sd4AiIkUbzGm/28SePwVclNL+2djzw9objohI+fJKuFNjzy8ENqS0j1cMe0l7wxERKV9eCXfAeTyGDftKMy32/MXtDUdEpHx5JdzNzuNfAf/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otVxuO3yrPO4l/t+RKSPdUrCdQuPTy4tChGRHLUr4R4L3ILVKhjFltU5m+p6A2ncVSMamTAhItI3hrCLXL5hEHdRexUvyfOc9xyY0VZEpC9dTvZY1Wvr2M8Mp33ayg8iIn1pLtYVkJVwN2OrPqR5gdN+z5ziFREpVSt9uCdQ37TbAWwab5pdnccrm45IRKSDtZJwd26grW89s1B4VrsGm1orItJzWkm4jSy+uCJje7jc+pLUViIiXayVhPtUne02Aj9P2b4l8Nrg8U9aiEdEpGfNpb6KWudn7OcUp+3eeQUrItLthkkfnXAp6WfRU5x93JJrpCIiXe4DRAl2A/BNbNztecDL6nj/FcF7NxKtzCsiIgkmUF1o/Bbq7xf+pPO+T+cSnYhIj9kNG4UQJs/fkj5kbArwDaf9rRS/jI6ISNeai62UECbR9ViNhfnA/lh3wTxstdv/OO1uwkYpiIhIA2ZSvbR52m091o0woZRIRUR6xMHYwopPUZtolwDnYt0QIiJ95f9dMRSjIJzDmgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 49,
       "width": 174
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "r = note.Rest(quarterLength=2.25)\n",
    "s = stream.Stream()\n",
    "s.append(r.splitAtDurations())\n",
    "s.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "sphinx_links": {
     "any": true
    }
   },
   "source": [
    "## Conclusion\n",
    "\n",
    "In this chapter we learned many of the advanced features of durations, such as how they can be composed of multiple components called `DurationTuples`, how triplets and other tuplets work, how durations can be linked or unlinked, and how splitting a Note or other object works.\n",
    "\n",
    "It's been a while since we've put all our knowledge to work, so in :ref:`Chapter 20, Examples 2 <usersGuide_20_examples2>` we'll consolidate our knowledge in the service of analysis."
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
